package com.example.lib.extend

import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Locale

fun String.toCurrentTimeMillis(reg: String = "EEE, dd MMM yyyy HH:mm:ss 'GMT'"): Long {
    return try {
        val f = SimpleDateFormat(reg, Locale.ENGLISH)
        f.parse(this@toCurrentTimeMillis)?.time ?: 0
    } catch (e: ParseException) {
        e.printStackTrace();0
    }
}